package com.liuzhu.chaoshikucungunli.model;

public class Product {
    private long id;
    private String name;
    private String code;
    private double price;
    private int quantity;
    private String unit;
    private String category;
    private String description;
    private String createTime;
    private String updateTime;
    private int imageResId;

    // 构造函数
    public Product() {}

    public Product(String name, String code, double price, String unit, int imageResId) {
        this.name = name;
        this.code = code;
        this.price = price;
        this.unit = unit;
        this.imageResId = imageResId;
    }

    public Product(String name, int quantity) {
        this.name = name;
        this.quantity = quantity;
        this.code = "CODE" + System.currentTimeMillis();  // 生成一个临时的唯一编码
        this.price = 0.0;
        this.unit = "个";
    }

    // Getter和Setter方法
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public int getImageResId() {
        return imageResId;
    }

    public void setImageResId(int imageResId) {
        this.imageResId = imageResId;
    }
} 